<!--********************************************************************
* Copyright© 2000 - 2024 SuperMap Software Co.Ltd. All rights reserved.
*********************************************************************-->
<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title data-i18n="resources.title_wmtsLayer"></title>
    <!-- <script type="text/javascript" src="../js/include-web.js"></script> -->
    <link rel="stylesheet" href="https://unpkg.com/leaflet@1.7.1/dist/leaflet.css" />
    <script src="https://unpkg.com/leaflet@1.7.1/dist/leaflet.js"></script>
</head>
<body style=" margin: 0;overflow: hidden;background: #fff;width: 100%;height:100%;position: absolute;top: 0;">
<div id="map" style="margin:0 auto;width: 100%;height: 100%"></div>
<script type="text/javascript" src="https://iclient.supermap.io/dist/leaflet/iclient-leaflet.min.js"></script>
<script type="text/javascript">
    var host = window.isLocal ? window.server : "https://iserver.supermap.io";

    var res = [];
    for (var i = 0; i < 22; i++) {
        res.push(165664.43905455674 / (Math.pow(2, i)));
    }
    var map = L.map('map', {
        center: [0, 0],
        maxZoom: 18,
        zoom: 0,
        crs: new L.supermap.Proj.CRS("EPSG:3857",
            {
                origin: [-2.0037508342789244E7, 2.0037508342789244E7],
                resolutions: res,
                bounds: L.bounds([-2.0037508342789244E7, -2.0037508342789244E7], [2.0037508342789244E7, 2.0037508342789244E7])
            })
    });
    new L.supermap.WMTSLayer(host + "/iserver/services/map-china400/wmts100",
        {
            layer: "China",
            style: "default",
            tilematrixSet: "Custom_China",
            format: "image/png",
            requestEncoding: 'REST',
            attribution: "Map Data <span>© <a href='http://support.supermap.com.cn/product/iServer.aspx' target='_blank'>SuperMap iServer</a></span>"
        }
    ).addTo(map);

</script>
</body>
</html> 